<ion-header>
    <ion-navbar no-border-bottom>
        <ion-title>
            {{params.isHis?"历史授权记录":"工作授权" }}
        </ion-title>
        <ion-buttons end *ngIf="!params.isHis">
            <button ion-button (click)="do()">授权操作</button>
        </ion-buttons>
    </ion-navbar>
    <ion-row class='authorization-list-searchbar'>
        <ion-col col-10>
            <ion-toolbar no-border-top>
                <ion-searchbar [(ngModel)]="params.nameCondition" color="light" placeholder="请输入标题关键字">
                </ion-searchbar>
            </ion-toolbar>
        </ion-col>
        <ion-col col-2>
            <button ion-button class="search-button" (click)="search()">查询</button>
        </ion-col>
    </ion-row>
</ion-header>
<ion-content class='main'>
    <ion-refresher (ionRefresh)="doRefresh($event)">
        <ion-refresher-content pullingText="下拉刷新" refreshingText="加载中...">
        </ion-refresher-content>
    </ion-refresher>
    <ion-list class='gfoa-list'>
        <ion-item *ngFor="let item of listData">
            <ion-row class='first-row'>
                <ion-col width-10 *ngIf="!params.isHis">
                    <ion-icon name="radio-button-off" *ngIf="!item.isChecked" (click)="iocnCheck(item)"></ion-icon>
                    <ion-icon name="checkmark-circle" *ngIf="item.isChecked" (click)="iocnCheck(item)" color="primary"></ion-icon>
                </ion-col>
                <ion-col width-70 class='left' (click)="goDetailPage(item)">
                    {{item.empidName+" 授权给 "+item.authorizedName}}
                </ion-col>
                <ion-col width-20 class='right' (click)="goDetailPage(item)">
                    <span *ngIf="item.stat=='STAR' " class="color_primary">启用</span>
                    <span *ngIf="item.stat=='STOP' " class="color_primary">暂停</span>
                </ion-col>
            </ion-row>
            <ion-row class='second-row' (click)="goDetailPage(item)">
                <ion-col lass='left'>
                    <span>授权日期：{{_.split(item.sdate," ")[0] + " ~ " + _.split(item.edate," ")[0]}}</span>
                </ion-col>
            </ion-row>
            <ion-row class='second-row' (click)="goDetailPage(item)">
                <ion-col>
                    <span *ngIf="item.type=='MODU' ">
                        {{"授权模块：" + item?.moduleName}}
                    </span>
                    <span *ngIf="item.type=='ALL' ">
                        {{"授权模块：全部子系统"}}
                    </span>
                </ion-col>
            </ion-row>
        </ion-item>
    </ion-list>
    <ion-item-divider class='list-no-more-tips' color="light" [hidden]="isLoadMore">暂无更多数据...</ion-item-divider>
    <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
        <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="加载更多数据...">
        </ion-infinite-scroll-content>
    </ion-infinite-scroll>
</ion-content>
